export class SqlHelper {
	public static toSQL(value: any): string {
		let sSQL: string

		const typeName = typeof value

		if (typeName === 'number') {
			sSQL = value
		} else if (typeName === 'object') {
			sSQL = `'${value as Date}'`
		} else if (typeName === 'boolean') {
			sSQL = (value as boolean) ? '1' : '0'
		} else {
			sSQL = `'${(value as string).replace("'", "''")}'`
		}
		return sSQL
	}
}
